package ex1.basic;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class JavaCollectionIteratorDemo {
	public static void main(String[] args) {
		Set<String> all = new TreeSet<String>();
		all.add("Hello");
		all.add("ScauJava");
		all.add("Scau");
		Iterator<String> iter = all.iterator();//实例化Iterator接口对象
		while (iter.hasNext()) {
			String str = iter.next();
			System.out.println(str);
		}
	}
}
